var t = getApp();

Page({
    data: {
        value: "",
        info: []
    },
    onLoad: function(t) {
        if (wx.setNavigationBarTitle({
            title: "核销"
        }), this.setData({
            options: t
        }), t.scene) {
            var o = decodeURIComponent(t.scene);
            if (o) {
                var a = [];
                a = o.split(",");
                for (var n = 0; n < a.length; n++) {
                    var i;
                    "log_id" == (i = a[n].split("="))[0] && this.setData({
                        "options.log_id": i[1]
                    });
                }
            }
        }
        this.getData();
    },
    getData: function() {
        var o = this;
        t._postNetWork({
            url: t.getNetAddresss("plugin.support-center.frontend.withdraw.write-off-page"),
            data: {
                log_id: this.data.options.log_id
            },
            success: function(a) {
                var n = a.data;
                1 == n.result ? o.setData({
                    info: n.data,
                    value: n.data.withdraw_money
                }) : t.tips(n.msg);
            },
            fail: function(t) {
                console.log(t.msg);
            }
        });
    },
    actionTag: function() {
        var o = this;
        t._postNetWork({
            url: t.getNetAddresss("plugin.support-center.frontend.withdraw.write-off-action"),
            data: {
                withdraw_money: this.data.value,
                log_id: this.data.options.log_id
            },
            success: function(a) {
                var n = a.data;
                1 == n.result ? (t.tips("核销成功"), o.getData()) : t.tips(n.msg);
            },
            fail: function(t) {
                console.log(t.msg);
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});